def tag_analysis(tag_attr, soup):
    match tag_attr:
        case "ULSxyf":
            if soup.find('span', class_='sOq4Gc') is not None:
                # Top stories
                topic = soup.find('span', class_='sOq4Gc').text
                json_file = {f"{topic}":[]}
                news_tags = soup.find_all('a', class_= "WlydOe")
                for news_tag in news_tags:
                    link = news_tag.get('href')
                    assignment = news_tag.find('div', class_= "MgUUmf NUnG9d").find('span').text
                    description = news_tag.find('div', class_= "n0jPhd ynAwRc tNxQIb nDgy9d").get_text()
                    json_file[f"{topic}"].append({
                        "link": link,
                        "assignment": assignment,
                        "description": description
                    })
                return json_file
            elif soup.find('div', class_="CA5RN"):
                # topic = soup.find('div', class_="CA5RN").find('span', class_="VuuXrf").get_text()
                # json_file = {f"{topic}": []}
                # news_tags = soup.find_all('a', class_="WlydOe")
                return None
            else:
                return None
        case "MjjYud":
            try:
                title = soup.find('h3').text
                link = soup.find('a').get('href')
                description = soup.find('div', class_="VwiC3b yXK7lf lVm3ye r025kc hJNv6b Hdw6tb").find_all('span')[-1].text
                json_file = {
                    "title": title,
                    "link": link,
                    "description": description
                }
                return json_file
            except:
                print(soup.text.replace("\n", ""))
                return None

# def json_make(keys, values):
